package com.ykt.service;

import com.jfinal.aop.Before;
import com.jfinal.plugin.activerecord.tx.Tx;
import com.ykt.model.PayRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 支付记录服务
 *
 * @author wing
 * @version 1.0.0
 */
public class PayRecordService {

    private static final Logger LOGGER = LoggerFactory.getLogger(PayRecordService.class);

    private PayRecord payRecordDao = PayRecord.dao;


    public PayRecord findById(Integer payRecordId) {
        return payRecordDao.findById(payRecordId);
    }

    @Before(Tx.class)
    public int save(PayRecord payRecord) {
        // 保存订单信息
        payRecord.save();
        // 返回订单ID
        return payRecord.get("id");
    }

}
